<?php
namespace app\index\controller;
use think\Db;
use think\Request;
use think\Controller;

class Phone
{
    // 话单接收
    public function phoneRecordReceive()
    {
        $datas['content'] = file_get_contents('php://input');
        $datas['type'] = 1;
        $datas['date'] = time();
        if (!empty($datas['content'])) {
            db('crm_phone_record')->insert($datas);
        }
        echo '{"r":"0"}';
    }

    // 录音文件接收
    public function recordingRecordReceive()
    {
        $datas['content'] = file_get_contents('php://input');
        $datas['type'] = 2;
        $datas['date'] = time();
        if (!empty($datas['content'])) {
            db('crm_phone_record')->insert($datas);
        }
        echo '{"r":"0"}';
    }

}
